package com.jbit.dm212.controller;

import com.jbit.dm212.common.ResponseResult;
import com.jbit.dm212.common.ResponseResultUtils;
import com.jbit.dm212.entity.dto.DmItemTypeDTO;
import com.jbit.dm212.entity.vo.DmItemTypeVO;
import com.jbit.dm212.service.DmItemTypeService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/item/api/p/type")
public class DmItemTypeController {;
    @Resource
    private DmItemTypeService dmItemTypeService;
    @PostMapping("/queryItemType")
    public ResponseResult<List<DmItemTypeDTO>> queryItemType(@RequestBody DmItemTypeVO itemTypeVO){
        return ResponseResultUtils.sendSuccess(dmItemTypeService.getItemTypeByParent(itemTypeVO.getParent()));
    }
}
